


import Koa from "koa"
import koaBodyParser from "koa-bodyparser"
import initCore from './core/Init'
import http from 'http'
const app = new Koa()
app.use(koaBodyParser())

// console.log(app.callback)
const server: http.Server = new http.Server(app.callback())
initCore(app,server)
// app.use(async (ctx, next) => {
//     ctx.body = `hello, path: '${ctx.request.path}'`
// })
app.listen(9000,()=> {
    console.log('\x1B[32m','run success')
    console.log('\x1B[34m','app started at port 9000...')
})   
server.setTimeout(0)
module.exports =  app
